#include <QStyledItemDelegate>
#include <QPushButton>
#include <QHBoxLayout>
#include <QApplication>

class ButtonDelegate : public QStyledItemDelegate{

    Q_OBJECT

public:
    ButtonDelegate(QObject *parent = nullptr);
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
    void setEditorData(QWidget *editor, const QModelIndex &index) const override;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
    void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override;

signals:
    void editClicked(const QModelIndex &index) const;
    void deleteClicked(const QModelIndex &index) const;
};
